<html>
<head>
    <style>
        @import url(../plus.css);
    </style>
    <script type="text/tiscript">

        namespace Test 
        {
          var counter = 0;
        }

        function self.ready() {
           self.timer(1s, function() {
             ++Test.counter;
             return true;            
           });

           View.Test = Test; // storing reference to it for sharing between views.
        }
      
        event click $(#open-dialog) {
           // Y-test-window-data-sharing-dialog
           view.dialog {
             url: self.url("Y-test-window-data-sharing-dialog.htm")
           };
        }

    </script>

</head>

<body model="Test">
  <button #open-dialog>Open dialog</button>

  <output|number(counter)>

</body>
</html>